package com.ape.mapsa.converters;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;

import org.apache.log4j.Logger;

import com.ape.mapsa.produccion.model.Muestra;

@FacesConverter(value = "MuestraConverter")
public class MuestraConverter implements Converter {
	private static final Logger logger = Logger.getLogger(MuestraConverter.class);
	
	@Override
	public Object getAsObject(FacesContext context, UIComponent component, String value) {
		logger.debug("converting muestra getting object");
		Muestra muestra = new Muestra();
		muestra.setName(value);
		return muestra;
	}

	@Override
	public String getAsString(FacesContext context, UIComponent component, Object value) {
		logger.debug("converting muestra getting string");
		return value.toString();
	}

}
